package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.dao.BankerProductImgDao;
import com.ytjj.qmyx.admin.model.request.BankerProductRequest;
import com.ytjj.qmyx.admin.service.BankerProductImgService;
import com.ytjj.qmyx.mall.model.BankerProductImg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * 
 * @Version: 1.0
 */
@Service
public class BankerProductImgServiceImpl implements BankerProductImgService {

    @Autowired
    private BankerProductImgDao bankerProductImgDao;

    @Override
    public CommonPage<BankerProductImg> getImgList(BankerProductRequest bankerProductRequest) {
        PageHelper.startPage(bankerProductRequest.getPageNum(), bankerProductRequest.getPageSize());
        List<BankerProductImg> pageList = bankerProductImgDao.getImgList(bankerProductRequest.getProductId(), bankerProductRequest.getType());
        return CommonPage.restPage(pageList);
    }

    @Override
    public List<BankerProductImg> oneClickView(Integer productId, String type) {
        return bankerProductImgDao.oneClickView(productId, type);
    }
}
